import pygame,sys

class MyBallClass(pygame.sprite.Sprite):
    def init_(self,image_file,speed,location=[0,0]):
     self.image=pygame.image.load(image_file)
     self.rest=self.image.get_rest()
     self.rest.left,self.rect.top=location
     self.speed=speed

def move(self):
    globaipoints,score_text
    self.rect=self.rect.move(self.speed)
    if self.rect.left<0 or self.rect.right>screen.get_width():
        self.speed[0]=-self.speed[0]
        if self.rect.top<screen.get_neight():
            hit_wall.play()

    if self.rect.top<=0:
        self.speed[1]=-self.speed[1]
        points=points+1
        score_test=font.render(str(points),1,(0,0,0))
        get_point.play()

class MyPaddleClass(pygame.sprite.Sprite):
    def init_(self,location=[0,0]):
        pygame.sprite.Sprite._init_(self)
        image_surface=pygame.surface.Surface([100,20])
        image_surface.fill([0,0,0])
        self.image    =image_surface.convert()
        self.rect=self.image.get_rect()
        self.rect.left,self.rect.top=location
pygame.init()
pygame.mixer.init()


pygame.mixer.music.load("by_music.mp3")
pygame.mixer.music.set_volume(0.3)
pygame.mixer.music.play(-1)
hit=pygame.mixer.Sound("hit_paddle.wav")
hit.set_volume(0.4)
new_life=pygame.mixer.Sound("new_life.wav")
new_life.set_volume(0.5)
splat=pygame.mixer.Sound("splat.wav")
splat.set_volume(0.6)
hit_wall=pygame.mixer.Sound("hit_wall.wav")
hit_wall.set_volume(0.4)